<!-- 个人中心 -->
<template>
	<view>
		<view class="team_box">
			<view class="team_item1">
				<view class="name1">团队总人数(人)</view>
				<view class="money1">{{team.one_team_sum + team.two_team_sum}}</view>
				<view class="team_br"></view>
				<view style="display: flex;">
					<view>
						<view class="name2">一级成员</view>
						<view class="money2">{{team.one_team_sum?team.one_team_sum:0}}</view>
					</view>
					<view style="margin-left: 30upx;">
						<view class="name2">二级成员</view>
						<view class="money2">{{team.two_team_sum?team.two_team_sum:0}}</view>
					</view>
				</view>
			</view>
			<!-- <view class="team_item2">
				<view class="name1">团队分销商人数(人)</view>
				<view class="money1">0</view>
				<view class="team_br"></view>
				<view style="display: flex;justify-content: space-between;">
					<view>
						<view class="name2">一级分销商</view>
						<view class="money2">0</view>
					</view>
					<view>
						<view class="name2">二级分销商</view>
						<view class="money2">0</view>
					</view>
				</view>
			</view> -->
		</view>
		<view class="team-list" v-if="TeamList.length>0">
			<view v-for="(item, i) in TeamList" :key="item.id">
				<view class="list-item">
					<view>
						<image style="width: 66rpx;height: 66rpx;" :src="(item.avatar)"></image>
					</view>
					<view style="margin-left: 30rpx;">
						<view style="display: flex;">
							<view class="list-name">{{item.nickname}}</view>
							<view class="list-dengji">{{item.level}}级</view>
						</view>
						<view class="list-bottom" style="">
							<view>{{item.createtime}}</view>
							<view class="chengyuan">下级成员:</view>
							<view class="num">{{item.team}} 人</view>
						</view>
					</view>
				</view>

			</view>
		</view>
		<view class="zanwubox" v-else>
			<view>
				<image style="width: 179rpx;height: 126rpx;"
					src="https://huboshizb.bigchun.com/uploads/20220912/70d472bf2b10985fd89ae75108064d62.png"></image>
			</view>
			<view class="zhanwu">暂无团队人员</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				team: {},
				TeamList: [

				]
			};
		},
		onLoad() {
			this.getData()
		},
		methods: {
			getData() {
				let that = this
				that.$api.teamList({}).then(res => {
					console.log('res', res)
					if (res.code == 1) {
						that.team = res.data
						that.TeamList = res.data.son_data
						console.log('11', that.TeamList)
					}
				});
			},

		}
	};
</script>
<style>
	page {
		background: #F5F5F5;
	}
</style>
<style lang="scss" scoped>
	* {
		box-sizing: border-box;
		margin: 0;
		padding: 0;

	}

	.team_item1 {
		background-size: 100% 100%;
		width: 750upx - 60upx;
		height: 232rpx;
		background-image: url('https://huboshizb.bigchun.com/uploads/20220912/68583ae2c45e72f175bceab28750dede.png');
		padding: 30upx 40rpx 20rpx 30upx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;

	}

	.team_item2 {
		background-size: 100% 100%;
		width: 336rpx;
		height: 232rpx;
		background-image: url('https://huboshizb.bigchun.com/uploads/20220912/b841601868c22015113236a27c7fc511.png');
		padding: 30rpx 40rpx 20rpx 30rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}

	.team_box {
		padding-top: 28rpx;
		display: flex;
		margin-left: 30rpx;
		margin-right: 30rpx;
		justify-content: space-between;

	}

	.team_br {
		border: 1rpx solid #FFFFFF;
		opacity: 0.38;
	}

	.name1 {
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #FFFFFF;
	}

	.money1 {
		font-size: 36rpx;
		font-family: Source Han Sans CN;
		font-weight: bold;
		color: #FFFFFF;
	}

	.name2 {
		font-size: 24rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #FFFFFF;
	}

	.money2 {
		font-size: 30rpx;
		font-family: Source Han Sans CN;
		font-weight: bold;
		color: #FFFFFF;
	}

	.zhanwu {
		font-size: 24rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #999999;
		margin-top: 40rpx;
	}

	.zanwubox {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		margin-top: 200rpx;
	}

	.team-list {
		margin-left: 30rpx;
		margin-right: 30rpx;
		margin-top: 36rpx;
		background: #FFFFFF;
		border-radius: 10rpx;
		padding-left: 30rpx;
		padding-top: 30rpx;
		padding-right: 30rpx;
	}

	.list-item {
		display: flex;
		border-bottom: 1px solid #eeeeee;
		margin-top: 30rpx;

	}

	.list-name {
		font-size: 30rpx;
		font-family: Source Han Sans CN;
		font-weight: bold;
		color: #333333;
	}

	.list-dengji {
		background-size: 100% 100%;
		width: 136rpx;
		height: 36rpx;
		background-image: url('/static/image/fenxiao20.png');
		text-align: center;
		font-size: 26rpx;
		font-weight: 400;
		color: #FFFFFF;
		margin-left: 16rpx;
	}

	.list-bottom {
		display: flex;
		margin-top: 18rpx;
		margin-bottom: 36rpx;
		font-size: 26rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #999999;
	}

	.chengyuan {
		margin-left: 30rpx;
	}

	.num {
		margin-left: 10rpx;
	}
</style>